// https://leetcode.cn/problems/pascals-triangle/

#include <iostream>
#include <vector>


using namespace std;

class Solution {
public:
    vector<int> getRow(int rowIndex) {
        vector<vector<int>> res = { {1}, { 1,1 } };
        if (rowIndex <= 1) {
            return res[rowIndex];
        }
        for (int i = 2; i <= rowIndex; i++) {
            vector<int> tmp = { 1 };
            for (int j = 1; j < i; j++) {
                tmp.push_back(res[i - 1][j] + res[i - 1][j - 1]);
            }
            tmp.push_back(1);
            res.push_back(tmp);
        }
        return res[rowIndex];
    }
};

int main() {
    Solution so;
    int n = 4;
    auto items = so.getRow(n);
    return 0;

}

